import math

def probability_of_failure(p1, p2, p12):
  """
  计算床甲或者机床乙至少有一台发生故障的概率
  :param p1: 机床甲发生故障的概率
  :param p2: 机床乙发生故障的概率
  :param p12: 两台机床同时发生故障的概率
  :return: 概率值
  """
  p1_given_p2 = p1 * (1 - p2) / (1 - p12)
  p2_given_p1 = p2 * (1 - p1) / (1 - p12)
  return p1_given_p2 + p2_given_p1-p12

# 测试
p1 = 0.1
p2 = 0.2
p12 = 0.05
print("机床甲或者机床乙至少有一台发生故障的概率为:{}".format(probability_of_failure(p1, p2, p12)))